package com.ly.controller;

import com.ly.pojo.User;
import com.ly.pojo.UserDTO;
import com.ly.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@CrossOrigin
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/login")
    public UserDTO<User> login( String phone,String password){
        UserDTO<User> userDTO = userService.login(phone, password);
        return userDTO;
    }

    @GetMapping("/check")
    public UserDTO<User> check(String token){
        UserDTO<User> check = userService.check(token);
        return check;
    }

}
